package com.glh.javalogic.chapter5._interface;

import android.util.Log;

import com.glh.javalogic.R;
import com.glh.javalogic.common.BaseActivity;

import java.util.Arrays;

/**
 * <pre>
 *     author : 高磊华
 *     e-mail : 984992087@qq.com
 *     time   : 2018/06/09
 *     desc   : 接口
 * </pre>
 */


public class InterfaceActivity extends BaseActivity {

    private static final String TAG = "InterfaceActivity";

    @Override
    protected int getContentResourseId() {
        return R.layout.activity_noview;
    }

    @Override
    protected void init() {

        MyComparable p1 = new Point(2, 3);
        MyComparable p2 = new Point(1, 2);
        Log.e("比较大小", "init: " + p1.compareTo(p2));


        Point[] points = new Point[]{
                new Point(2, 3),
                new Point(3, 4),
                new Point(1, 2)
        };

        Log.e("最大值", "init: " + CompUtil.max(points));


        CompUtil.sort(points);
        Log.e("排序", "init: " + Arrays.toString(points));


        Child cv2 = new Child();
        cv2.addAll(new int[]{1, 2, 3});
        cv2.add(-1);
        Log.e(TAG, "继承是把双刃剑....... " + cv2.getSum());


    }
}
